package com.wanmait.bootdemo.controller;

import com.wanmait.bootdemo.pojo.QuestionType;
import com.wanmait.bootdemo.service.QuestionTypeService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;
import java.util.List;

@Controller
@RequestMapping("/manage/questionType")
public class QuestionTypeController {
    @Resource
    private QuestionTypeService questionTypeService;
    @RequestMapping("list")
    @ModelAttribute("questionTypes")

    public List<QuestionType> list(){
        return questionTypeService.findAll();
    }
    @RequestMapping("view")
    @ResponseBody
    public QuestionType findById(Integer id){
        return questionTypeService.findById(id);
    }
}
